require File.dirname(__FILE__)+'/include.rb'

  
app = DrunkenMaster::HtmlApplication.new()
app.router.plug Cms::Desktop, '/'

adapter = DrunkenMaster::RackAdapter.new(app)

rack_app = Rack::Builder.new {
  use Rack::CommonLogger 
  use Rack::ShowExceptions
  map "/" do
    #use Rack::Lint
    run adapter
  end
}  

sessioned = Rack::Session::Pool.new(rack_app,
  :key => 'dm.session',
  #:domain => '127.0.0.1', # if you want to force the domain
  :path => '/',
  :expire_after => 1*24*60*60
)

#employ any rack handler you wish
handler = Rack::Handler::Mongrel
handler.run(sessioned, {
    #:Port => 8081, :Host => '127.0.0.1'
    # to show your friends use these args instead:
    :Port => 80, :Host => '0.0.0.0'
  })
